package org.jeecg.modules.flower.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Param;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.flower.entity.FlowerOutorderinfo;
import org.jeecg.modules.flower.entity.FlowerOutorder;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.flower.entity.FlowerTagInfo;
import org.springframework.web.bind.annotation.RequestParam;

import java.io.IOException;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Collection;
import java.util.List;

/**
 * @Description: 出库单主表
 * @Author: jeecg-boot
 * @Date:   2022-06-27
 * @Version: V1.0
 */
public interface IFlowerOutorderService extends IService<FlowerOutorder> {

	/**
	 * 添加一对多
	 * 
	 */
	public String saveMain(FlowerOutorder flowerOutorder,List<FlowerOutorderinfo> flowerOutorderinfoList) throws IOException;
	
	/**
	 * 修改一对多
	 * 
	 */
	public void updateMain(FlowerOutorder flowerOutorder,List<FlowerOutorderinfo> flowerOutorderinfoList);

	/**
	 * 修改子表
	 *
	 */
	public void updateFlowerOutorderinfo(List<FlowerOutorderinfo> flowerOutorderinfoList);
	
	/**
	 * 删除一对多
	 */
	public void delMain (String id);
	
	/**
	 * 批量删除一对多
	 */
	public void delBatchMain (Collection<? extends Serializable> idList);


	/**
	 *
	 * 根据出库单id查询出库台账信息
	 * @param id
	 * @return
	 */
	List<FlowerTagInfo> getTaginfoByOutoerderID(String id);


	IPage<FlowerTagInfo> getFlowerVarietys(IPage<FlowerTagInfo> page , Wrapper<FlowerTagInfo> wrapper);
	IPage<FlowerTagInfo> getFlowerVarietys2(IPage<FlowerTagInfo> page , Wrapper<FlowerTagInfo> wrapper);


	/**
	 * kuguan qkuguan 库管确认
	 * @descriptionauthor
	 * @author gf
	 * 2022-11-23 13:27
	 * [id]
	 * @return int
	 */
	int sureOutDo(String id) throws IOException;
	int sureOutDoBack(String id) throws IOException;

	/**
	 *
	 * @descriptionauthor 基地负责人审核
	 * @author gf
	 * 2022-11-23 17:52
	 * [id]
	 * @return java.lang.String
	 */
	public String fiunalSure(@RequestParam(value = "id") String id) throws IOException;
	/**
 *运管确认
 * @descriptionauthor
 * @author gf
 * 2022-9-27 16:25
 * []
 * @return
 */
	Integer transportPipe(String id, String remarks , BigDecimal sumNum , BigDecimal sumTotalprice) throws IOException;
	/**
	 *撤销运管确认
	 * @descriptionauthor
	 * @author gf
	 * 2022-10-8 14:10
	 * [id]
	 * @return java.lang.Integer
	 */
	Integer transportPipeBack(String id) throws IOException;

	/**
	 * 提交审核 提交审核----扣减库存改到此处
	 * @descriptionauthor
	 * @author gf
	 * 2023-1-3 12:27
	 *
	 * @return
	 */
	Integer toPress(String id) throws IOException;
	/**
	 *
	 * @descriptionauthor 提交审核-撤销
	 * @author gf
	 * 2023-1-3 12:27
	 * [id]
	 * @return java.lang.Integer
	 */
	Integer toPressBack(String id) throws IOException;

	/**
	 *
	 * @descriptionauthor结算确认
	 * @author gf
	 * 2023-2-6 9:20
	 * [flowerOutorder]
	 * @return java.lang.Integer
	 */
	Integer accountSure(FlowerOutorder flowerOutorder) throws IOException;
	/**
	 *结算确认-撤销
	 * @descriptionauthor
	 * @author gf
	 * 2023-2-6 9:20
	 * [id]
	 * @return java.lang.Integer
	 */
	Integer accountSureBack(String id) throws IOException;
}
